{breadcrumbs}<a href="{$GLOBALS.site_url}/user-groups/">User Groups</a> &#187; Add a New User Group{/breadcrumbs}
{assign var="switchColumns" value=false}
<h1><img src="{image}/icons/usersplus32.png" border="0" alt="" class="titleicon" />Add User Group</h1>
{include file="field_errors.tpl"}

<fieldset>
<legend>Add a New User Group</legend>

	<form method="post">
		<input type="hidden" name="action" value="add">
		<table>
	{foreach from=$form_fields key=field_id item=form_field}
		{if $form_field.id == 'user_activation_email'}
			{assign var="switchColumns" value=true}
			{assign var="group" value="user"}
			</table>
			<div id="mediumButton" class="setting_button">Default Notification Settings<div class="setting_icon"><div id="accordeonClosed"></div></div></div>
				<div  class="setting_block" style="display: none">
				<table>
					<tr>
						<td colspan="3" style='font-size:11px'>These settings will be applied by default for newly registered users of this group.</td>
					</tr>
					<tr>
						<td colspan="3" style='font-size:16px;font-weight: bold;'>General User Notifications:</td>
					</tr>
		{/if}
		{if $form_field.id == 'notify_on_listing_activation'}
			{assign var="group" value="listing"}
			<tr>
				<td colspan="3" style='font-size:16px;font-weight: bold;'>Listing Notifications:</td>
			</tr>
		{/if}
		{if $form_field.id == 'notify_on_application_approve'}
			{assign var="group" value="other"}
		{/if}
		{if $form_field.id == 'notify_subscription_activation'}
			<tr>
				<td colspan="3" style='font-size:16px;font-weight: bold;'>Product Notifications:</td>
			</tr>
			{assign var="group" value="product"}
		{/if}
		{if $form_field.id == 'notify_subscription_expire_date' || $form_field.id == 'notify_subscription_expire_date_days' || $form_field.id == 'notify_listing_expire_date' || $form_field.id == 'notify_listing_expire_date_days' || $form_field.id == 'notify_on_application_approve' || $form_field.id == 'notify_on_application_reject' }
			{if $form_field.id == 'notify_subscription_expire_date'}
				<tr>
					<td colspan="1">{$form_field.caption}{if $form_field.is_required}<font color="red">*</font>{/if}</td>
					<td colspan="2">
						{input property=$form_field.id  template="list_none.tpl"}
						{if $user_group_info[$form_field.id]}
						<a href="{$GLOBALS.site_url}/edit-email-templates/{$group}/{$user_group_info[$form_field.id]}"
						   target="_blank"><img src="{image}pen.png" border="0" alt="Edit {$form_field.caption}"
												title="Edit {$form_field.caption}" class="editEmailTemp"/></a>
						{/if}
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td class="notifications">{input property=$form_fields.notify_subscription_expire_date_days.id}</td>
					<td>Days before</td>
				</tr>
			{elseif $form_field.id == 'notify_listing_expire_date'}
				<tr>
					<td colspan="1">{$form_field.caption}{if $form_field.is_required}<font color="red">*</font>{/if}</td>
					<td colspan="2">
						{input property=$form_field.id template="list_none.tpl"}
						{if $user_group_info[$form_field.id]}
						<a href="{$GLOBALS.site_url}/edit-email-templates/{$group}/{$user_group_info[$form_field.id]}"
						   target="_blank"><img src="{image}pen.png" border="0" alt="Edit {$form_field.caption}"
												title="Edit {$form_field.caption}" class="editEmailTemp"/></a>
						{/if}
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td class="notifications">{input property=$form_fields.notify_listing_expire_date_days.id}</td>
					<td>Days before</td>
				</tr>
			{elseif $form_field.id eq 'notify_on_application_approve' || $form_field.id eq 'notify_on_application_reject'}
				{if $user_group_info.id == 'JobSeeker'}
				<tr>
					<td colspan="1">{$form_field.caption}{if $form_field.is_required}<font color="red">*</font>{/if}</td>
					<td colspan="2">
						{input property=$form_field.id template="list_none.tpl"}
						{if $user_group_info[$form_field.id]}
						<a href="{$GLOBALS.site_url}/edit-email-templates/{$group}/{$user_group_info[$form_field.id]}"
						   target="_blank"><img src="{image}pen.png" border="0" alt="Edit {$form_field.caption}"
												title="Edit {$form_field.caption}" class="editEmailTemp"/></a>
						{/if}
					</td>
				</tr>
				{/if}
			{/if}
		{else}
			<tr>
				{if $switchColumns}
					<td colspan="1">{$form_field.caption}{if $form_field.is_required}<font color="red">*</font>{/if}</td>
					<td colspan="2">
						{input property=$form_field.id template="list_none.tpl"}
						{if $user_group_info[$form_field.id]}
						<a href="{$GLOBALS.site_url}/edit-email-templates/{$group}/{$user_group_info[$form_field.id]}"
						   target="_blank"><img src="{image}pen.png" border="0" alt="Edit {$form_field.caption}"
												title="Edit {$form_field.caption}" class="editEmailTemp"/></a>
						{/if}
					</td>
				{else}
					<td valign="top" width="42%">{$form_field.caption}</td>
					<td>{if $form_field.is_required}<font color="red">*</font>{/if}</td>
					<td>{input property=$form_field.id}</td>
				{/if}
			</tr>
		{/if}
	{/foreach}
		</table>
		</div>
        <div class="clr"><br/></div>
        <div class="floatRight"><input type="submit" value="Add" class="grayButton" /></div>
	</form>
</fieldset>

{literal}
<script>

$(".setting_button").click(function(){
	var butt = $(this);
	$(this).next(".setting_block").slideToggle("normal", function(){
			if ($(this).css("display") == "block") {
				butt.children(".setting_icon").html("<div id='accordeonOpen'></div>");
			} else {
				butt.children(".setting_icon").html("<div id='accordeonClosed'></div>");
			}
		});
});


</script>
{/literal}